package util.enumhelper;

import java.util.Comparator;

public class DoubleComparator implements Comparator {

    @Override
    public int compare(Object obj1, Object obj2) {
        DoubleHelper help1 = (DoubleHelper) obj1;
        DoubleHelper help2 = (DoubleHelper) obj2;

        double diff = help1.getDoubleNum() - help2.getDoubleNum();
        if (diff == 0) {
            return 0;
        }

        if (diff < 0) {
            return 1;
        }

        return -1;
    }
}
